
package com.memorytech.starchive.utils;

import android.content.Context;
import android.content.SharedPreferences;

public class SaveData {

    private static SaveData saveData = null;
    private SharedPreferences sharePreference;

    public SaveData(Context context)
    {
        sharePreference = context.getSharedPreferences("BarcodeReader", Context.MODE_PRIVATE);
    }

    public static SaveData getInstance(Context context)
    {
        if (saveData == null)
        {
            saveData = new SaveData(context);
        }
        return saveData;
    }

    public void sethostname(String hostname)
    {
        sharePreference.edit().putString("hostname", hostname).commit();
    }

    public String gethostname()
    {
        return sharePreference.getString("hostname", "");
    }
}
